sudo apt install -y libopenblas-base libomp-dev
python3 -m pip install -r requirements.txt
python3 -m pip install faiss-cpu --no-cache

python3 -m pip install --upgrade "openai>=1.0"

cd Tool
cd rag
rm -rf c-rust-code-fracs
unzip c-rust-code-fracs.zip
cd ..

cd blockfinder && cargo build && cd ..
cd cargopubadder && cargo build && cd ..
cd codeextractor && cargo build && cd ..
cd contextextractor && cargo build && cd ..
cd fix-unclosed-delimiter && cargo build && cd ..
cd merge-impl && cargo build && cd ..
cd remove-funcdecl && cargo build && cd ..
cd symbol-table && cargo build && cd ..
## 定义文件路径
file="single-check/src/check.rs"
## 追加空的 main 函数
echo "fn main() {}" > "$file"
cd single-check && cargo build && cd ..

## 定义文件路径
file="src-test/src/main.rs"
## 追加空的 main 函数
echo "fn main() {}" > "$file"
cd src-test && cargo build && cd ..
cd rust_translator
cargo update -p home@0.5.11 --precise 0.5.9
cargo build && cd ..
cd rust_header_filter
cargo update -p home@0.5.11 --precise 0.5.9
cargo build && cd ..
cd rust_refactor && cargo build && cd ..
